<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>试题中心</title>
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/templatemo-style.css" rel="stylesheet" />
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/api.js"></script>
  </head>

  <body>
    <div class="templatemo-flex-row">
      <div class="templatemo-sidebar">
        <div class="mobile-menu-icon">
          <i class="fa fa-bars"></i>
        </div>
        <nav class="templatemo-left-nav">
          <ul>
            <li>
              <a href="考试中心.html"
                ><i class="fa fa-map-marker fa-fw"></i>考试中心</a
              >
            </li>
            <li>
              <a href="#" class="active"
                ><i class="fa fa-database fa-fw"></i>试题中心</a
              >
            </li>
            <li>
              <a href="成绩中心.html"
                ><i class="fa fa-bar-chart fa-fw"></i>成绩中心</a
              >
            </li>
            <li>
              <a href="批改中心.html"
                ><i class="fa fa-star" aria-hidden="true"></i>批改中心</a
              >
            </li>
            <li>
              <a href="个人信息.html"
                ><i class="fa fa-user-o" aria-hidden="true"></i>个人信息</a
              >
            </li>
            <li>
              <a href="index.html"><i class="fa fa-eject fa-fw"></i>退出</a>
            </li>
          </ul>
        </nav>
      </div>
      <div class="templatemo-content col-1 light-gray-bg">
        <div class="templatemo-content-container">
          <div
            class="templatemo-flex-row flex-content-row templatemo-overflow-hidden"
          >
            <div class="col-1 templatemo-overflow-hidden">
              <div
                class="templatemo-content-widget white-bg templatemo-overflow-hidden"
              >
                <div class="templatemo-flex-row flex-content-row">
                  <div id="app" class="container">
                    <form class="form-horizontal">
                      <div class="form-group col-xs-8">
                        <label class="col-sm-2 control-label">题目</label>
                        <div class="col-sm-10">
                          <input
                            type="text"
                            class="form-control"
                            id="question"
                            placeholder="请输入题目"
                            autocomplete="off"
                            oninput="this.value=this.value.replace(/\s+/g,'')"
                          />
                        </div>
                      </div>

                      <div class="col-xs-2">
                        <select
                          id="selectType"
                          class="form-control"
                          @change="changeType"
                          :v-if="true"
                        >
                          <option value="-1">---请选择---</option>
                          <option value="1">单选题</option>
                          <option value="2">多选题</option>
                          <option value="3">主观题</option>
                        </select>
                      </div>

                      <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                          <label id="input">
                            <label>
                              <input
                                :type="type"
                                name="select"
                                value="A"
                                :disabled="disabled"
                              />&nbspA.
                              <input
                                type="text"
                                id="optionA"
                                class="form-control"
                                placeholder="请输入选项 A"
                                :disabled="disabled"
                                autocomplete="off"
                                oninput="this.value=this.value.replace(/\s+/g,'')"
                              />
                            </label>
                            <br />
                            <label>
                              <input
                                :type="type"
                                name="select"
                                value="B"
                                aria-label="..."
                                :disabled="disabled"
                              />&nbspB.
                              <input
                                type="text"
                                id="optionB"
                                class="form-control"
                                placeholder="请输入选项 B"
                                :disabled="disabled"
                                autocomplete="off"
                                oninput="this.value=this.value.replace(/\s+/g,'')"
                              />
                            </label>
                            <br />

                            <label>
                              <input
                                :type="type"
                                name="select"
                                value="C"
                                aria-label="..."
                                :disabled="disabled"
                              />&nbspC.
                              <input
                                type="text"
                                id="optionC"
                                class="form-control"
                                placeholder="请输入选项 C"
                                :disabled="disabled"
                                autocomplete="off"
                                oninput="this.value=this.value.replace(/\s+/g,'')"
                              />
                            </label>
                            <br />
                            <label>
                              <input
                                :type="type"
                                name="select"
                                value="D"
                                aria-label="..."
                                :disabled="disabled"
                              />&nbspD.
                              <input
                                type="text"
                                id="optionD"
                                class="form-control"
                                placeholder="请输入选项 D"
                                :disabled="disabled"
                                autocomplete="off"
                                oninput="this.value=this.value.replace(/\s+/g,'')"
                              />
                            </label>
                          </label>

                          <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                              <button
                                type="button"
                                class="btn btn-primary"
                                @click="submit"
                              >
                                添加
                              </button>
                            </div>
                          </div>
                        </div>
                      </div>

                      <div class="col-xs-3">
                        <select
                          id="selectProfession"
                          class="form-control"
                          @change="changeOption"
                        >
                          <option value="-1">---请选择---</option>
                          <option
                            v-for="item in relevanceList"
                            :value="item.profession_no"
                            >{{ item.profession_name }}
                          </option>
                        </select>
                      </div>

                      <div class="col-xs-3">
                        <select
                          id="selectCourse"
                          class="form-control"
                          @change="changeOption"
                        >
                          <option value="-1">---请选择---</option>
                          <option
                            v-for="item in relevanceList"
                            :value="item.course_no"
                            >{{ item.course_name }}</option
                          >
                        </select>
                      </div>

                      <div class="input-group col-sm-3">
                        <input
                          id="search"
                          type="text"
                          class="form-control"
                          placeholder="搜索试题"
                          @input="searchQuestion"
                          oninput="this.value=this.value.replace(/\s+/g,'')"
                        /><span
                          class="input-group-addon btn btn-primary"
                          @click="searchQuestion"
                          >搜索</span
                        >
                      </div>
                      <table class="table table-hover">
                        <tr class="tb_head">
                          <th class="col-xs-3">题目</th>
                          <th>类型</th>
                          <th>选项&nbspA</th>
                          <th>选项&nbspB</th>
                          <th>选项&nbspC</th>
                          <th>选项&nbspD</th>
                          <th>正确答案</th>
                          <th>操作</th>
                        </tr>

                        <tr v-for="item in questions" :data-queno="item.que_no">
                          <td>{{ item.question }}</td>
                          <td>{{ item.type }}</td>
                          <td v-for="index in item.option">{{ index }}</td>
                          <td>{{ item.goodkey }}</td>
                          <td>
                            <div
                              class="btn-group btn-group-sm"
                              role="group"
                              aria-label="..."
                            >
                              <button
                                type="button"
                                class="btn btn-warning"
                                data-toggle="modal"
                                data-target=".bs-example-modal-lg"
                                :id="item.que_no"
                                @click="showMoQuestion"
                              >
                                修改
                              </button>
                              <button
                                type="button"
                                :id="item.que_no"
                                class="btn btn-danger"
                                @click="deleteQuestion"
                              >
                                删除
                              </button>
                            </div>
                          </td>
                        </tr>
                      </table>

                      <div
                        class="modal fade bs-example-modal-lg"
                        tabindex="-1"
                        role="dialog"
                        aria-labelledby="myLargeModalLabel"
                      >
                        <div class="modal-dialog modal-lg" role="document">
                          <div class="modal-content">
                            <form class="form-horizontal">
                              <div class="form-group col-xs-8">
                                <label class="col-sm-2 control-label"
                                  >题目</label
                                >
                                <div class="col-sm-10">
                                  <input
                                    type="text"
                                    class="form-control"
                                    id="question_2"
                                    placeholder="请输入题目"
                                    autocomplete="off"
                                  />
                                </div>
                              </div>

                              <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                  <label id="input_2">
                                    <label>
                                      <input
                                        :type="readyType"
                                        name="select"
                                        value="A"
                                        aria-label="..."
                                        :disabled="disabled2"
                                      />&nbspA.
                                      <input
                                        type="text"
                                        id="optionA_2"
                                        class="form-control"
                                        autocomplete="off"
                                        placeholder="请输入选项 A"
                                        :disabled="disabled2"
                                      />
                                    </label>
                                    <br />
                                    <label>
                                      <input
                                        :type="readyType"
                                        name="select"
                                        value="B"
                                        aria-label="..."
                                        :disabled="disabled2"
                                      />&nbspB.
                                      <input
                                        type="text"
                                        id="optionB_2"
                                        class="form-control"
                                        autocomplete="off"
                                        placeholder="请输入选项 B"
                                        :disabled="disabled2"
                                      />
                                    </label>
                                    <br />

                                    <label>
                                      <input
                                        :type="readyType"
                                        name="select"
                                        value="C"
                                        aria-label="..."
                                        :disabled="disabled2"
                                      />&nbspC.
                                      <input
                                        type="text"
                                        id="optionC_2"
                                        class="form-control"
                                        autocomplete="off"
                                        placeholder="请输入选项 C"
                                        :disabled="disabled2"
                                      />
                                    </label>
                                    <br />
                                    <label>
                                      <input
                                        :type="readyType"
                                        name="select"
                                        value="D"
                                        aria-label="..."
                                        :disabled="disabled2"
                                      />&nbspD.
                                      <input
                                        type="text"
                                        id="optionD_2"
                                        class="form-control"
                                        autocomplete="off"
                                        placeholder="请输入选项 D"
                                        :disabled="disabled2"
                                      />
                                    </label>
                                  </label>
                                </div>
                              </div>

                              <div class="modal-footer">
                                <button
                                  type="button btn-group-sm"
                                  class="btn btn-default"
                                  data-dismiss="modal"
                                >
                                  关闭
                                </button>

                                <button
                                  type="button"
                                  class="btn btn-primary"
                                  data-dismiss="modal"
                                  @click="submit2"
                                >
                                  保存
                                </button>
                              </div>
                            </form>
                          </div>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <script src="js/试题中心.js"></script>
  </body>
</html>
